package com.xauto.pioneer.appuser.adapter;

import android.app.Activity;
import android.view.View;
import android.widget.TextView;

import com.xauto.pioneer.appuser.R;
import com.xauto.pioneer.appuser.model.OrderInfo;
import com.xauto.pioneer.appuser.model.OrderTotalInfo;

/**
 * Created by Lemon on 2015/12/11.
 * Desc:订单分项明细 适配器
 */
public class ExpenseAdapter extends AbsAdapter<OrderTotalInfo> {

    public ExpenseAdapter(Activity context, int layout) {
        super(context, layout);
    }

    @Override
    public ViewHolder<OrderTotalInfo> getHolder() {
        return new TemplateViewHolder();
    }


    private class TemplateViewHolder implements ViewHolder<OrderTotalInfo> {

        private TextView expense_name;
        private TextView expense_money;


        @Override
        public void initViews(View v, int position) {
            expense_name = (TextView) v.findViewById(R.id.expense_name);
            expense_money = (TextView) v.findViewById(R.id.expense_money);
        }

        @Override
        public void updateData(OrderTotalInfo orderTotalInfo, int position) {
            expense_name.setText(orderTotalInfo.order_total_name);
            expense_money.setText(orderTotalInfo.order_total_amount_format);
        }

        @Override
        public void doOthers(OrderTotalInfo orderInfo, int position) {

        }
    }
}
